package com.metalgun.Main;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try{
			ServerSocket listen = new ServerSocket(18000,5);
			Socket service;
			
			while(true){
				System.out.println("ici");
				service = listen.accept();
				System.out.println("la");
				/*OutputStream out = service.getOutputStream();
				String response="Bodji est noob a CS";
				byte[] tabresponse = response.getBytes();
				out.write(tabresponse);*/
				InputStream in = service.getInputStream();
				int response;
				
				while ((response=in.read()) != -1) {
					System.out.print((char)response);
				}
				service.close();
			}
		}catch (Exception e) {
			e.getStackTrace();
		}

	}

}
